Skip to content

Conversation

@TimWolla
Copy link
Member

This clarifies the relationship between these constants and improves type safety a little.

…ype` enum

This clarifies the relationship between these constants and improves type
safety a little.
Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable, thanks!


#define ZEND_CLASS_CONST_FLAGS(c) Z_CONSTANT_FLAGS((c)->value)

#if __STDC_VERSION__ >= 202311L
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this also works for C++11. Not important to me, but maybe other folks.

ZEND_USER_FUNCTION = 2,
ZEND_EVAL_CODE = 4,
};
typedef enum _zend_function_type zend_function_type;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Names starting with underscore are reserved to the implementation .We've previously done effort to get rid of underscores in places and generally don't add new ones.

};
typedef enum _zend_function_type zend_function_type;
#else
enum _zend_function_type {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit unfortunate that this is a duplicated definition. Changing one code smell with another.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants